package com.ymatou.app.seller.service;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*发布直播商品接口Call
*FreeMaker Template自动生成代码
*/
public class AddProductV2Call extends YmatouBaseCall{
	private static String opurl ="api/Product/AddProductV2";
	public AddProductV2Call() {
		super(EnvSetup.getSystemUrl("seller_app"),opurl,"POST","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		//User-Agent: 02ios====8.4.1=DF50A6A6-0281-44BF-9D60-07412CE57EB1============================2.3.1=appStore========
		client.addHeader("User-Agent", "02ios====9.3===5F58DCEF-D449-46FF-81EF-02B569B9B260============================3.0.0=appStore========");
	}
	@Override
	public void callService(){
		try {
			//不用转义
			super.callService(false);
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	
	/**
	 * 获取Status
	 * 
	 * @return Status
	 */
	public int getStatus() {
		int Status = 500;
		try {
			JSONObject jo = new JSONObject(getReturnData());			
			Status=jo.getInt("Status");		
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Status;
	}
	
}